#include "thread_pool.h"

namespace simpleThread {
    ThreadPool::ThreadPool() : ThreadPool((int) std::thread::hardware_concurrency()) {}

    ThreadPool::ThreadPool(int size) : ThreadPool(size, size) {}

    ThreadPool::ThreadPool(int coreSize, int maxSize) : threadManage(coreSize, maxSize) {
        this->threadManage.initThreads();
    }

    ThreadPool::~ThreadPool() {
        this->shutdown();
    }

    void ThreadPool::join() {
        this->threadManage.join();
    }

    void ThreadPool::shutdown() {
        this->threadManage.shutdown();
    }

    bool ThreadPool::isClose() {
        return this->threadManage.isClose();
    }

    int ThreadPool::getCoreSize() const {
        return this->threadManage.getCoreSize();
    }

    int ThreadPool::getMaxSize() const {
        return this->threadManage.getMaxSize();
    }
}